home *** CD-ROM | disk | FTP | other *** search
/ Aminet 24 / Aminet 24 (1998)(GTI - Schatztruhe)[!][Apr 1998].iso / Aminet / comm / misc / Tickle85.lha / Tickle85 / Install Tickle85 next >
Text File  |  1998-02-22  |  6KB  |  201 lines

  1. ;*************************************************************
  2. ;
  3. ;   Installer for Tickle85
  4. ;       v0.3
  5. ;
  6. ;   Copyright 1998 CircleSoft
  7. ;
  8. ;   Author of installer: Markus Mannevaara (mamannev@abo.fi)
  9. ;
  10. ;*************************************************************
  11.  
  12. ; Defining vars
  13.  
  14. ;************
  15. ; PROCEDURES
  16. ;************
  17.  
  18. (procedure P_USERQUESTIONS
  19.         (set @default-dest
  20.             (askdir (disk)
  21.                 (prompt
  22.                     ("Where do you want to install %s?\n" @app-name)
  23.                     ("A drawer named %s will be created." @app-name)
  24.                 )
  25.                 (help
  26.                     ("You should select where you want to install %s. " @app-name)
  27.                     ("A directory named %s will be created there.\n\n" @app-name)
  28.                     @askdir-help
  29.                 )
  30.                 (default @default-dest)
  31.             )
  32.         )
  33.         (set #mode
  34.             (askchoice
  35.                 (prompt "How would you like to set up the paths for your Tickle85 installation?")
  36.                 (help
  37.                     "You should select how you want the installation to handle your paths. Here is some guidance "
  38.                     "to your selection.\n\n"
  39.                     "Option 1 is recommended. It will keep your paths and your user-startup clean, and allows you to "
  40.                     "place frequently used commands into the path. (You can choose which commands and which directory). "
  41.                     "The other files will be placed into the Tickle85 directory\n\n"
  42.                     "Option 2 will place all files into the Tickle85 directory. It will keep your system-installation clean, but will modify your user-startup "
  43.                     "in order to add a directory to your path.\n\n"
  44.                     "Option 3 simply copies all files into the Tickle85 directory, nothing will happen to your "
  45.                     "paths, your s:user-startup, or your system directories. It's clean, and easy to delete, "
  46.                     "but you can't access Tickle85 from anywhere else in the system."
  47.                 )
  48.                 (choices
  49.                     "1. Place the most frequently used files into the path."
  50.                     "p2. Add the Tickle85 directory to the path."
  51.                     "3. Stay away from my paths! Put everything in the Tickle85 directory."
  52.                 )
  53.                 (default 0)
  54.             )
  55.         )
  56.         (if (= #mode 0)
  57.             (set #pathfiles
  58.                 (askoptions
  59.                     (prompt
  60.                         "Which files would you like to place in your path?\n"
  61.                         "See help for details on each file."
  62.                     )
  63.                     (help
  64.                         "Send85 is used to send variables to the TI-85, very frequently used.\n\n"
  65.                         "Recv85 is used to receive variables from the TI-85, also frequently used.\n\n"
  66.                         "TICableTest is used to test the link-cable, only used once, if at all."
  67.                     )
  68.                     (choices
  69.                         "Send85 (recommended)"
  70.                         "Recv85 (recommended)"
  71.                         "TICableTest"
  72.                     )
  73.                     (default 3)
  74.                 )
  75.             )
  76.             (set #pathfiles 0)
  77.         )
  78.             (if (> #pathfiles 0)
  79.                 (set #pathdir
  80.                     (askdir
  81.                         (disk)
  82.                         (prompt "Where in the path would you like the frequently used commands to be placed?")
  83.                         (help
  84.                             "Normally, you would want to place the files in 'C:' with the other commands, "
  85.                             "but if you have other plans, you may place them where you please."
  86.                             @askdir-help
  87.                         )
  88.                         (default "C:")
  89.                     )
  90.                 )
  91.             )
  92. (askbool
  93.     (prompt
  94.         "You have made these choices.\n\n"
  95.         ("The destination directory is: \"%s\"\n\n" (tackon @default-dest @app-name))
  96.         (if (> #pathfiles 0) ("However, these files: "))
  97.         (if (BITAND 1 #pathfiles) ("Send85, "))
  98.         (if (BITAND 2 #pathfiles) ("Recv85, "))
  99.         (if (BITAND 4 #pathfiles) ("TICableTest "))
  100.         (if (> #pathfiles 0) ("will be copied to '%s'.\n\n" #pathdir))
  101.         (if (= #mode 1) ("The path to \"%s\" will be added to your user-startup.\n\n" (tackon @default-dest @app-name)))
  102.         "Are the choices correct?"
  103.     )
  104.     (help
  105.         "You are presented with the choices you made in earlier questions, if you are satisfied with them, click on \"Yes\", and the installation will continue.\n\n"
  106.         "If you wish to alter your choices, click on \"No\"\n\n"
  107.     )
  108.     (default 1)
  109.  
  110. )
  111. )
  112.  
  113. ;********
  114. ;  MAIN
  115. ;********
  116.  
  117. (if (< (/ (getversion) 65536) 37) (abort ("%s requires at least AmigaOS v2.0." @app-name)))
  118.  
  119. (welcome ("Welcome to the %s installation utility!" @app-name))
  120.  
  121.  
  122.  
  123. ;  Choose where&what to install
  124. ; =============================
  125.  
  126. (set @default-dest "Work:")
  127.  
  128. (if (> @user-level 0)
  129.     (message
  130.         ("You will now be asked a few questions about how you want to install %s.\n\n" @app-name)
  131.         "Your choices will be displayed before any actions are taken, so that you can correct any errors made.")
  132.     )
  133. (while (= (P_USERQUESTIONS) 0))
  134.  
  135. ;  Copy da stuff
  136. ; ===============
  137.  
  138. (set @default-dest (tackon @default-dest @app-name))
  139.  
  140. ; Send85
  141.  
  142. (if (BITAND 1 #pathfiles)
  143.     (set #dest #pathdir)
  144.     (set #dest @default-dest)
  145. )
  146. (copyfiles
  147.     (prompt "Copying Send85")
  148.     (source "Send85")
  149.     (dest #dest)
  150. )
  151.  
  152. ; Recv85
  153.  
  154. (if (BITAND 2 #pathfiles)
  155.     (set #dest #pathdir)
  156.     (set #dest @default-dest)
  157. )
  158. (copyfiles
  159.     (prompt "Copying Recv85")
  160.     (source "Recv85")
  161.     (dest #dest)
  162. )
  163.  
  164. ; TICableTest
  165.  
  166. (if (BITAND 4 #pathfiles)
  167.     (set #dest #pathdir)
  168.     (set #dest @default-dest)
  169. )
  170. (copyfiles
  171.     (prompt "Copying TICableTest")
  172.     (source "TICableTest")
  173.     (dest #dest)
  174. )
  175.  
  176. ; Docs
  177.  
  178. (copyfiles
  179.     (prompt "Copying Tickle85.guide")
  180.     (source "Tickle85.guide")
  181.     (dest @default-dest)
  182. )
  183.  
  184. (copyfiles
  185.     (prompt "Copying Cable instructions")
  186.     (source "TICable")
  187.     (pattern "#?")
  188.     (dest (tackon @default-dest "TICable"))
  189. )
  190.  
  191. (if (= #mode 1)
  192.     (startup
  193.         (@app-name)
  194.         (prompt ("Poking S:User-startup.\n\nMay I add the following line?\n\nC:Path \"%s\"" @default-dest))
  195.         (help "Click proceed and your user-startup gets it!\n\nThis procedure is required for you to be able to use Tickle85 from anywhere in the system. "
  196.               "Tickle will only work from its own directory otherwise. (No harm will be done in any case.)"
  197.         )
  198.         (command ("C:Path \"%s\"" @default-dest))
  199.     )
  200. )
  201.